<?php
class IndexAction extends Action {
	
	public function index() {
		$o = M('home');
		$home = $o->find();

		$this->assign('home', $home);

		$this->display ();
	}

	public function listen() {

        $data = Array(
            'title' => $_GET['title'],
            'age' => $_GET['age'],
            'sex' => $_GET['sex'],
            'shenfen' => $_GET['shenfen'],
            'phone' => $_GET['phone'],
            'posttime' => time()
        );

        $o = M ( 'listen' );
        $st = $o->add ($data);

        if ($st !== false) {
            $result = Array(
                'status' => 1
            );
        } else {
            $result = Array(
                'status' => 0
            );
        }

        echo json_encode($result);
    }
}
?>